/*
 * PorePressureTimeDerivativeKernel.C
 *
 *  Created on: 2017年7月24日
 *      Author: liuxiao
 */

#include "PorePressureTimeDerivativeKernel.h"

registerMooseObject("TrilobitaApp", PorePressureTimeDerivativeKernel);

template<>
InputParameters validParams<PorePressureTimeDerivativeKernel>()
{
  InputParameters params = validParams<TimeDerivative>();
  return params;
}

PorePressureTimeDerivativeKernel::PorePressureTimeDerivativeKernel(const InputParameters & parameters) :
    TimeDerivative(parameters),
	_porosity(getMaterialProperty<Real>("porosity")),
	_rhog(getMaterialProperty<Real>("rhog")),
	_porosity_old(getMaterialPropertyOld<Real>("porosity")),
	_rhog_old(getMaterialPropertyOld<Real>("rhog"))
{
}

Real PorePressureTimeDerivativeKernel::computeQpResidual()
{
	Real Res = _porosity[_qp] * _rhog[_qp];
	Real Res_old = _porosity_old[_qp] * _rhog_old[_qp];
	return (Res - Res_old)/ _dt * _test[_i][_qp];

}

Real PorePressureTimeDerivativeKernel::computeQpJacobian()
{
  Real r(0);
 // r = _porosity[_qp]/_R[_qp]/_temperature[_qp]*_phi[_j][_qp]*_du_dot_du[_qp]*_test[_i][_qp];
  return r;
}
